<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../../js/bootstrap-3.3.7-dist/css/bootstrap.min.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/footer.css" />
		<link rel="stylesheet" type="text/css" href="../../../css/swiper-3.4.2.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/record_audit.css" />

		<link rel="stylesheet" type="text/css" href="../../../../common/js/bootstrap-3.3.7-dist/css/bootstrap-datatimepicker.4.14.47.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/manager.css" />
		<!--画图插件-->
		<script src="../../../js/flexible.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.foot:nth-child(1) {
				color: #e83023;
			}
		</style>
	</head>

	<body>
		<div id="wrap">
			<div id="main">
				<div id="header">
					<a id="headImg" href="javascript:history.go(-1)"><img class="headImg" src="../../../images/12.png" /></a>
					<p id="headTitle" style="font-size: 16px;">日志审核</p>
				</div>
				<div id="content" style="padding-top: 1.2rem;background-color: #FFFFFF;">
					<div class="top">
						<div class="form-group" style="float: left;width: 48%;font-size: 12px;height: 33px;margin-bottom: 0px;font-size: 0.2rem;margin-left: 2.3%;margin-right: 0.25rem;">
							<select id="time" onchange="joblogSearch();" style="background-color: #FFFFFF;height: 31px;width: 90%;" class="form-control">
								<option value="">时间</option>
							</select>
						</div>

						<select id="fankui" onchange="joblogSearch();" style="width: 45%;height: 31px;background-color: #FFFFFF;" class="form-control">
							<option value="">全部</option>
							<option value="1">已反馈</option>
							<option value="0">未反馈</option>
						</select>

						<p style="margin-top: 0.277777rem;">
							<input type="text" id="searchName" placeholder="提交人" />
							<a href="javascript:void(0)" onclick="joblogSearch();">
								<img src="../../../images/coalltion/search.png" />
							</a>
						</p>
					</div>
					<div id="checkYf">

					</div>
				</div>
			</div>
			<div id="foot" class="row">
				<a class="foot col-xs-3 col-sm-3" href="../../kaoqin/index2.html">
					<img class="footImg" src="../../../images/guanlixuanzhong.png" />
					<p>管理</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../../coalition/colalition.html">
					<img class="footImg" src="../../../images/lianmengchushi.png" />
					<p>联盟</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../../store/store.html">
					<img class="footImg" src="../../../images/11.png" />
					<p>商城</p>
				</a>
				<a class="foot col-xs-3 col-sm-3" href="../../personage/personIndex.html">
					<img class="footImg" src="../../../images/13.png" />
					<p>我的</p>
				</a>
			</div>
		</div>

	</body>
	<script src="../../../js/jquery-2.2.3.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../js/bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../js/handlebars-v2.0.0.js" type="text/javascript" charset="utf-8"></script>

	<script src="../../../js/rhAdmin.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../js/Chart.addTest.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../../common/js/bootstrap-3.3.7-dist/js/moment-with-locales.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../../../common/js/bootstrap-3.3.7-dist/js/bootstrap-datatimepicker.4.14.47.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		$(function() {
			joblogSearch();
		});

		var checkName = "receivePerson"; //审核人id
		//获取已提交的日志
		function joblogSearch() {
			$("#checkYf").empty();
			var urls = "http://10.0.47.157:5555/companyapplyfor-service/joblog/search?pageNum=1&pageSize=100&checkName=" + checkName;
			var time = $("#time").val(); //时间
			var fankui = $("#fankui").val(); //是否已反馈
			var searchName = $("#searchName").val(); //提交人姓名
			if(time != null && time != "") {
				urls += "&time=" + time;
			}
			if(fankui != null && fankui != "") {
				urls += "&checkStatus=" + fankui;
			}
			if(searchName != null && searchName != "") {
				urls += "&subName=" + searchName;
			}
			
			//加时间筛选  传时间后台获取该月信息 
			$.ajax({
				cache: false,
				type: "GET",
				url: urls,
				dataType: "JSON",
				async: false,
				error: function(XMLHttpRequest, textStatus, errorThrown) {
					alert("网络异常请稍后重试！");
				},
				success: function(data) {
					var item1_list = '<ul class="list">';
					for(var i = 0; i < data.joblogList.list.length; i++) {
						var list = data.joblogList.list[i];
						var checkStatus;
						switch(list.checkStatus) {
							case "0":
								checkStatus = "待反馈";
								break;
							case "1":
								checkStatus = "已反馈";
								break;
							default:
								checkStatus = "-";
								break;
						}
						item1_list += '<li><a href="record_feedback.html?id=' + list.id + '"><p><span class="list_title">审核</span> <span class="list_status">' + checkStatus + '</span></p><p style="color: #7b7a7a;"><span class="list_content">' + list.subName + '成功的提交了工作日志</span><span class="list_time">' + list.subDate + '</span></p></a></li>';
					}
					item1_list += '</ul>'
					$("#checkYf").append(item1_list);
				}
			});
		}
		var date = new Date(); // new 一个Date对象
		var year = date.getFullYear(); // 年份
		var month = date.getMonth() + 1; // 月份（从0开始，所以应+1）
		var r = date.getDate();
		var a;
		for(var i = month; i > month - 12; i--) {
			if(i == 0) {
				a = 12;
				year -= 1
			} else {
				if(i < 10) {
					a = "" + 0 + i
				} else {
					a = i;
				}
			}
			$('<option value="' + year + '-' + a + '-' + r + '">' + year + "年" + a + "月" + "</option>").appendTo($("#time")); // 依次添加下拉框选项，value自定义，右边的appendTo参数为目标选择框
		}

		/*	//模糊搜索
			function isContains(str, substr) {
				return new RegExp(substr).test(str);
			}

			function search() {
				$(".list li").hide();
				$.each($(".list li"), function(idx, item) {
					console.log($('#fankui').val())
					if(isContains(item.children[0].children[1].children[1].innerHTML, $('#time').val()) && (item.children[0].children[0].children[1].innerHTML == $('#fankui').val() || $('#fankui').val() == '') && isContains(item.children[0].children[1].children[0].innerHTML, $('#searchName').val())) {
						$(this).show();
					}
				});
			}

			$('#time').on('change', function() {
				search();
			})
			$('#fankui').on('change', function() {
				search();
			})
			$('#searchName').on('change', function() {
				search();
			})
			search();*/
	</script>

</html>